const router = require('koa-router')(),
      indexController = require('../controllers/Index'),
      loginCheck = require('../middlewares/loginCheck');

// router.get('/', indexController.index);
//获取所有课程信息
router.get('/get_books', loginCheck, indexController.getBookData);
//获取推荐书本数据
router.get('/get_recom_book', loginCheck, indexController.getRecomBook);
//获取轮播图数据
router.get('/get_sliders', loginCheck, indexController.getSliders);
//获取作者信息
router.get('/get_author', loginCheck, indexController.getAuthors);
//获取海报广告图
router.get('/get_poster_book', loginCheck, indexController.getPosterBook);


//改变书本管理那里的分类
router.post('/change_books_field', loginCheck, indexController.changeBookField);
//改变所有产品的上下架状态
router.post('/change_status', loginCheck, indexController.changeDataStatus);
//选择是否为明星作者
router.post('/select_star_author', loginCheck, indexController.changeAuthorStar);


module.exports = router;